/*
 * Author: Dao Anh Vu
 */
#ifndef _PHYSIC_H
#define _PHYSIC_H

#include <jni.h>

typedef struct {
    const char* name;
    const char* signature;
} JavaMethod;

typedef struct {
    char* name;
    char* signature;
} JavaField;


void jni_initialize(JNIEnv *env, jobject);
int jni_setFunction(JNIEnv *env, jobject, jstring, jarray);
double jni_f(JNIEnv *env, jobject, jarray);
jstring jni_get_derivative(JNIEnv *env, jobject);
void jni_release(JNIEnv *env, jobject thiz);

static const char* FunctionClassPath = "nautilus/lab/model/Function";

static JNINativeMethod physic_methods[] = {
	{"jniInitilize", "()V", (void*)jni_initialize},
	{"jniSetFunction", "(Ljava/lang/String;[C)I", (void*)jni_setFunction},
	{"f", "([D)D", (void*)jni_f},
	{"jniGetDerivative", "()Ljava/lang/String;", (void*)jni_get_derivative},
	{"jniRelease", "()V", (void*)jni_release}
};

#endif
